package com.jingzhi.huimiao.adapter;

import com.jingzhi.huimiao.MainActivity;
import com.jingzhi.huimiao.fragment.FindFragment;
import com.jingzhi.huimiao.fragment.MainFragment;
import com.jingzhi.huimiao.fragment.MineFragment;
import com.jingzhi.huimiao.fragment.ReviewFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class FragmentAdapter extends FragmentPagerAdapter {

	public FragmentAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int id) {
		switch (id) {
		case MainActivity.TAB_RADIO1:
			MainFragment mainFragment = new MainFragment();
			return mainFragment;
		case MainActivity.TAB_RADIO2:
			ReviewFragment reviewFragment = new ReviewFragment();
			return reviewFragment;
		case MainActivity.TAB_RADIO3:
			FindFragment findFragment = new FindFragment();
			return findFragment;
		case MainActivity.TAB_RADIO4:
			MineFragment mineFragment = new MineFragment();
			return mineFragment;
		}
		return null;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 4;
	}

}
